import request from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 登录api接口集合
 * @method signIn 用户登录
 * @method signOut 用户退出登录
 */
export function useAppsApi() {
	return {
		listByAppPage: (data: object) => {
			return request({
				url: '/api/admin/app/listByAppPage',
				method: 'post',
				data,
			});
		},
		add: (data: object) => {
			return request({
				url: '/api/admin/app/add',
				method: 'post',
				data,
			});
		},
		edit: (data: object) => {
			return request({
				url: '/api/admin/app/edit',
				method: 'post',
				data,
			});
		},
		removeById: (data: object) => {
			return request({
				url: '/api/admin/app/removeById',
				method: 'post',
				data,
			});
		},
		/**
		 * 申请应用上下线
		 * @param data
		 */
		applyApp: (data: object) => {
			return request({
				url: '/api/admin/app/applyApp',
				method: 'post',
				data,
			});
		},
		/**
		 * 应用上下线
		 * @param data
		 */
		applyAppOnLineOffline: (data: object) => {
			return request({
				url: '/api/admin/app/applyAppOnLineOffline',
				method: 'post',
				data,
			});
		},
		topping: (data: object) => {
			return request({
				url: '/api/admin/app/topping',
				method: 'post',
				data,
			});
		}
	};
}
